package com.example.mypro;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {
	private Button btn_01;
	private Button btn_02;
	private Button btn_03;
	private Button btn_04;
	private Button btn_05;
	private Button btn_06;
	private Button btn_07;
	private Button btn_08;
	private Button btn_09;
	private Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		btn_01 = (Button) findViewById(R.id.main_btn_01);
		btn_02 = (Button) findViewById(R.id.main_btn_02);
		btn_03 = (Button) findViewById(R.id.main_btn_03);
		btn_04 = (Button) findViewById(R.id.main_btn_04);
		btn_05 = (Button) findViewById(R.id.main_btn_05);
		btn_06 = (Button) findViewById(R.id.main_btn_06);
		btn_07 = (Button) findViewById(R.id.main_btn_07);
		btn_08 = (Button) findViewById(R.id.main_btn_08);
		btn_09 = (Button) findViewById(R.id.main_btn_09);
		btn_01.setOnClickListener(this);
		btn_02.setOnClickListener(this);
		btn_03.setOnClickListener(this);
		btn_04.setOnClickListener(this);
		btn_05.setOnClickListener(this);
		btn_06.setOnClickListener(this);
		btn_07.setOnClickListener(this);
		btn_08.setOnClickListener(this);
		btn_09.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.main_btn_01:
			intent = new Intent(MainActivity.this, XinWenActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_02:
			intent = new Intent(MainActivity.this, JiaoshiActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_03:
			intent = new Intent(MainActivity.this, DianyingActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_04:
			intent = new Intent(MainActivity.this, SchoolViewActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_05:
			intent = new Intent(MainActivity.this, EntertainmentActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_06:
			intent = new Intent(MainActivity.this, FoodActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_07:
			intent = new Intent(MainActivity.this, LibraryActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_08:
			intent = new Intent(MainActivity.this, LiveActivity.class);
			startActivity(intent);
			break;
		case R.id.main_btn_09:
			intent = new Intent(MainActivity.this, LoginActivity.class);
			startActivity(intent);
			break;
		}

	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		System.exit(0);
	}

}
